<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 日期</title>
</head>
<body>
<h2>日期</h2>
<p>var d = new Date();</p>

<p id="demo"></p>

<script>
  var d = new Date();
  document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

<!--输出显示当前日期-->